package com.jec.module.sysconfig.service.configor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Component;

import com.jec.module.sysconfig.dao.BroadcastRepository;
import com.jec.module.sysconfig.entity.BroadcastConfig;
import com.jec.module.sysconfig.service.convertor.BroadcastConvertor;
import com.jec.module.sysconfig.service.convertor.Convertor;

@Component
public class BroadcastConfigor extends BaseConfigor<BroadcastConfig> {
	
	@Autowired
	private BroadcastRepository broadcastRepository;
	
	@Autowired 
	private BroadcastConvertor broadcastConvertor;

	public BroadcastConfigor() {
		logKey = "广播";
	}

	@Override
	protected JpaRepository<BroadcastConfig, Integer> getRepository() {
		return broadcastRepository;
	}

	@Override
	protected Convertor<BroadcastConfig> getConvertor() {
		return broadcastConvertor;
	}

	@Override
	public boolean hasConfigOnNetunit(int netunit) {
		return !broadcastRepository.findAllByNetunit(netunit).isEmpty();
	}
	
	

}
